//
//  CZOrderDetailSignCell.m
//  TCProject
//
//  Created by admin on 16/1/25.
//  Copyright © 2016年 wise-wing. All rights reserved.
//

#import "CZOrderDetailSignCell.h"

@interface CZOrderDetailSignCell()
@property (weak, nonatomic) IBOutlet UIButton *dateLabel;
@property (weak, nonatomic) IBOutlet UIButton *distanceLabel;

@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UIButton *statusButton;


@end

@implementation CZOrderDetailSignCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setLog:(ServiceLog *)log
{
    _log = log;
    
    [_statusButton setImage:[UIImage imageNamed:@"status_work1"] forState:UIControlStateNormal];
    switch (_log.status) {
        case 0:
            [_statusButton setTitle:@"待签收" forState:UIControlStateNormal];
            break;
        case 1:
            [_statusButton setTitle:@"待结算" forState:UIControlStateNormal];
            break;
        case 2:
            [_statusButton setTitle:@"已结算" forState:UIControlStateNormal];
            [_statusButton setImage:[UIImage imageNamed:@"status_work0"] forState:UIControlStateNormal];
            break;
    }
    _priceLabel.text = [NSString stringWithFormat:@"￥%.1f", _log.realsumPrice];
    [_dateLabel setTitle:[NSString stringWithFormat:@"提交时间：%@", _log.startTime] forState:UIControlStateNormal];
    if ([@"砼车" isEqualToString:_order.style1]) {
        [_distanceLabel setTitle:[NSString stringWithFormat:@"运输方量：%.1f方", _log.volume] forState:UIControlStateNormal];
    } else {
        [_distanceLabel setTitle:[NSString stringWithFormat:@"泵距方量：%.1f方", _log.volume] forState:UIControlStateNormal];
    }
}


@end
